package com.ifonly.render.renders;

import com.ifonly.render.Render;
import com.ifonly.render.RenderException;

/**
 * @author <a href="mailto:ifonlymaster@163.com">ifonly</a>
 * @version 1.0 2015-12-10 15:07
 * @since JDK 1.6
 */
public class JspRender extends Render {

    public JspRender(String view) {
        this(view, null);
    }

    public JspRender(String view, String extension) {
        super(view, extension);
    }

    @Override
    public void render() {
        String view = getView();
        try {
            request.getRequestDispatcher(view).forward(request, response);
        } catch (Exception e) {
            throw new RenderException(e);
        }
    }

}
